
SET(QTPROPERTYBROWSER_DIR "" CACHE PATH "Set to base QTPROPERTYBROWSER install path")
MACRO( FIND_QTPROPERTYBROWSER_INCLUDE THIS_QTPROPERTYBROWSER_INCLUDE_DIR THIS_QTPROPERTYBROWSER_INCLUDE_FILE )

FIND_PATH( ${THIS_QTPROPERTYBROWSER_INCLUDE_DIR} ${THIS_QTPROPERTYBROWSER_INCLUDE_FILE}
    PATHS
        ${QTPROPERTYBROWSER_DIR}
        $ENV{QTPROPERTYBROWSER_SOURCE_DIR}
        $ENV{QTPROPERTYBROWSERDIR}
        $ENV{QTPROPERTYBROWSER_DIR}
        /usr/local/
        /usr/
        /sw/ # Fink
        /opt/local/ # DarwinPorts
        /opt/csw/ # Blastwave
        /opt/
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;QTPROPERTYBROWSER_ROOT]/
        ~/Library/Frameworks
        /Library/Frameworks
    PATH_SUFFIXES
        /include/
)

ENDMACRO( FIND_QTPROPERTYBROWSER_INCLUDE THIS_QTPROPERTYBROWSER_INCLUDE_DIR THIS_QTPROPERTYBROWSER_INCLUDE_FILE )

FIND_QTPROPERTYBROWSER_INCLUDE( QTPROPERTYBROWSER_INCLUDE_DIR       include/qttreepropertybrowser.h )

###### libraries ######

MACRO( FIND_QTPROPERTYBROWSER_LIBRARY MYLIBRARY MYLIBRARYNAME )

FIND_LIBRARY(${MYLIBRARY}
    NAMES
        ${MYLIBRARYNAME}
    PATHS
        ${QTPROPERTYBROWSER_DIR}
        $ENV{QTPROPERTYBROWSER_BUILD_DIR}
        $ENV{QTPROPERTYBROWSER_DIR}
        $ENV{QTPROPERTYBROWSERDIR}
        ~/Library/Frameworks
        /Library/Frameworks
        /usr/local
        /usr
        /sw
        /opt/local
        /opt/csw
        /opt
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;QTPROPERTYBROWSER_ROOT]/lib
        /usr/freeware
    PATH_SUFFIXES
        /lib/
        /lib64/
        /build/lib/
        /build/lib64/
        /Build/lib/
        /Build/lib64/
     )

ENDMACRO(FIND_QTPROPERTYBROWSER_LIBRARY LIBRARY LIBRARYNAME)

FIND_QTPROPERTYBROWSER_LIBRARY( QTPROPERTYBROWSER_LIBRARY_DEBUG QtPropertyBrowser2.5_d)



FIND_QTPROPERTYBROWSER_LIBRARY( QTPROPERTYBROWSER_LIBRARY QtPropertyBrowser2.5)



SET( QTPROPERTYBROWSER_FOUND "NO" )
IF( QTPROPERTYBROWSER_LIBRARY AND QTPROPERTYBROWSER_INCLUDE_DIR )
    SET( QTPROPERTYBROWSER_FOUND "YES" )
    SET( QTPROPERTYBROWSER_INCLUDE_DIRS ${QTPROPERTYBROWSER_INCLUDE_DIR})
    GET_FILENAME_COMPONENT( QTPROPERTYBROWSER_LIBRARIES_DIR ${QTPROPERTYBROWSER_LIBRARY} PATH )
ENDIF( QTPROPERTYBROWSER_LIBRARY AND QTPROPERTYBROWSER_INCLUDE_DIR )


